package com.zbkj.common.vo.project;

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.google.common.collect.Lists;
import com.zbkj.common.model.project.EstimateFundoc;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @Auther:
 * @Date: 2024/10/8 19:22
 * @Description:
 */
@Getter
@Setter
public class FunDocVo {

    @ApiModelProperty("原文索引")
    private Integer idx;

    @ApiModelProperty("原文位置")
    private String idxLoc;

    @ApiModelProperty("索引文档")
    private String idxDoc;

    public static List<EstimateFundoc> toPojoBatch(Long projectId, String reqNo, List<FunDocVo> srcTextList) {
        List<EstimateFundoc> docList = Lists.newArrayList();
        if(CollectionUtils.isEmpty(srcTextList)) {
            return docList;
        }
        for (FunDocVo vo : srcTextList) {
            EstimateFundoc pojo = new EstimateFundoc();
            pojo.setIdx(vo.getIdx());
            pojo.setIdxLoc(vo.getIdxLoc());
            pojo.setIdxDoc(vo.getIdxDoc());
            pojo.setProjectId(projectId);
            pojo.setReqNo(reqNo);
            docList.add(pojo);
        }
        return docList;
    }
}
